package com.linxz.wandnroid.pojo;

import com.chad.library.adapter.base.entity.MultiItemEntity;
import com.linxz.wandnroid.enums.GankBeanType;
import com.linxz.wandnroid.pojo.GankBean;

/**
 * @author Linxz
 * 创建日期：2020年02月28日 22:48
 * version：v4.5.4
 * 描述：
 */
public class GankMultiBean implements MultiItemEntity {

    private GankBean gankBean;
    private int position;

    public GankBean getGankBean() {
        return gankBean;
    }

    public void setGankBean(GankBean gankBean) {
        this.gankBean = gankBean;
    }

    public int getPosition() {
        return position;
    }

    public void setPosition(int position) {
        this.position = position;
    }

    @Override
    public int getItemType() {
        if (gankBean.getImages()==null || gankBean.getImages().size()==0){
            return GankBeanType.TEXT.getType();
        }
        if (gankBean.getImages().size()==1){
            if (position%2==0){
                return GankBeanType.ONE_BIG_IMAGE.getType();
            }else{
                return GankBeanType.ONE_SMALL_IMAGE.getType();
            }
        }
        if (gankBean.getImages().size()==2){
            return GankBeanType.TWO_IMAGE.getType();
        }
        return GankBeanType.MULTI_IMAGE.getType();
    }
}
